


export const NOT_LOADED = "NOT_LOADED"; // 没有加载过
export const LOADING_SOURCE_CODE = "LOADING_SOURCE_CODE"; // 加载原代码
export const NOT_BOOTSTRAPPED = "NOT_BOOTSTRAPPED"; // 没有启动
export const BOOTSTRAPPING = "BOOTSTRAPPING"; // 启动中
export const NOT_MOUNTED = "NOT_MOUNTED"; // 没有挂载
export const MOUNTING = "MOUNTING"; // 挂载中
export const MOUNTED = "MOUNTED"; // 挂载完毕
export const UPDATING = "UPDATING"; // 更新中
export const UNMOUNTING = "UNMOUNTING"; // 接触挂载
export const UNLOADING = "UNLOADING"; // 完全卸载中
export const LOAD_ERROR = "LOAD_ERROR"; // 加载资源失败失败
export const SKIP_BECAUSE_BROKEN = "SKIP_BECAUSE_BROKEN"; // 运行出错

// 当前app是否已经被激活，只有挂载完毕才算是被激活
export function isActive(app) {         
    return app.status === MOUNTED;
}

// 当前app是否应该激活
export function shouldBeActive(app) { 
    // 如果返回true，那么应用应该就开始初始化等一些列操作
    return app.activeWhen(window.location);
}